<template>
	<view>
		<view class="wrap">
			<u-navbar :is-back="false" title="消息">
				<u-icon name="wifi" style="margin-left: 15rpx;"></u-icon>{{tin}}
			</u-navbar>

			<u-search bg-color="#ffffff" placeholder="搜索群" shape="square" height="80" v-model="keyword" margin="0rpx 0rpx 20rpx 0rpx"
			 @custom="search(keyword)"></u-search>
			 
			 <u-row gutter="16" v-for="(item, index) in searchList" :key="index">
			 	<u-col span="2" @click="gotoChat(item)">
			 		<view class="demo-layout bg-purple">
			 			<u-avatar :src="item.groupImg" size="70"></u-avatar>
			 		</view>
			 	</u-col>
			 	<u-col span="7" @click="gotoChat(item)">
			 		<view class="demo-layout bg-purple">
			 			<h4>{{item.groupName}}</h4>
			 			<h5>{{item.groupText}}</h5>
			 		</view>
			 	</u-col>
			 	<u-col span="3" @click="gotoChat(item)">
			 		<view class="demo-layout bg-purple">
			 			<h6>{{item.tip}}</h6>
			 			<p>{{item.updateTime.split('T')[0]}}</p>
			 			<p>{{item.updateTime.split('T')[1].split('Z')[0]}}</p>
			 		</view>
			 	</u-col>
			 </u-row>
			 
			 <u-cell-item title="群组" :arrow="false">{{indexList.length}}</u-cell-item>
			 <u-loading :show="isIndexList" mode="circle" color="blue" size="72"></u-loading>
			 
			<u-row gutter="16" v-for="(item, index) in indexList" :key="index">
				<u-col span="2" @click="gotoChat(item)">
					<view class="demo-layout bg-purple">
						<u-avatar :src="item.groupImg" size="70"></u-avatar>
					</view>
				</u-col>
				<u-col span="7" @click="gotoChat(item)">
					<view class="demo-layout bg-purple">
						<h4>{{item.groupName}}</h4>
						<h5>{{item.groupText}}</h5>
					</view>
				</u-col>
				<u-col span="3" @click="gotoChat(item)">
					<view class="demo-layout bg-purple">
						<h6>{{item.tip}}</h6>
						<p>{{item.updateTime.split('T')[0]}}</p>
						<p>{{item.updateTime.split('T')[1].split('Z')[0]}}</p>
					</view>
				</u-col>
			</u-row>

		</view>
		<u-tabbar v-model="current" :list="downList" :mid-button="false" :before-switch="beforeSwitch"></u-tabbar>
	</view>
</template>

<script src="./index.js">
	
</script>

<style src="./index.css">
	
</style>
